package com.example.sequences.core.jpa;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.*;
import java.util.Date;

/**
 * BaseEntity
 *
 * @author maxsc
 * @title BaseEntity.java
 * @date 2018/5/8
 */
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Getter
@Setter
public class BaseEntity {
    @Id
    @GenericGenerator(name="id", strategy="com.example.sequences.core.jpa.Idprovider")
    @GeneratedValue(generator="id")
    private String id;
    @Version
    private Integer banBen;
    @CreatedDate
    private Date createDate;
    @CreatedBy
    private String createBy;
    @LastModifiedDate
    private Date lastModifiedDate;
    @LastModifiedBy
    private String lastModifiedBy;
}
